#!/bin/sh
#
# Tries to upgrade from V0.2 to V0.3
#
# Those methods that have changed their signature are marked with the
# comment /* NEEDS WORK */
#
# Usage: upgrade < OldCode.java > NewCode.java
#

sed -e '
    s/\<AuthTypeNotImplementedException\>/AuthSchemeNotImplException/g
    s/\<ProtocolNotSupportedException\>/ProtocolNotSuppException/g
    s/\<Codecs.getParameter\>/Util.getParameter/g
    s/\<socksHost\>/HTTPClient.&/g
    s/\<socksPort\>/HTTPClient.&/g
    s/\<socksVersion\>/HTTPClient.&/g
    s/\<HTTPConnection\.addAuthorizationInfo\>/AuthorizationInfo\.addAuthorizationInfo \/* NEEDS WORK *\/ /g
    s/\<AuthorizationInfo\.setAuthHandler(null)/HTTPConnection\.setDefaultAllowUserInteraction(false)/g
'

